home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
ELECTRON
/
PCB_DESI
/
1540.ZIP
/
PCBCA110.ZIP
/
GRAPHICS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-11-18
|
1KB
|
50 lines
#include <stdio.h>
#include <stdlib.h>
#ifndef VMS
#include <dos.h>
#endif
/* graphics support routines */
void Dot( int, int, int );
int GetMode( void );
void SetMode( int );
void Dot ( color, row, col ) /* draw a dot on the screen */
int color, row, col;
{
union REGS regs;
/*printf("Dot(color=%d,row=%d,col=%d)\n",color,row,col);*/
/*return;*/
regs.h.ah = 0xC; /* write pixel */
regs.h.al = (char)color;
regs.x.bx = 0;
regs.x.cx = col;
regs.x.dx = row;
int86( 0x10, ®s, ®s );
}
int GetMode () { /* get the graphics screen mode */
union REGS regs;
regs.h.ah = 0xF; /* get graphics mode */
int86( 0x10, ®s, ®s );
regs.h.ah = 0;
/*printf("GetMode() returns %d\n",regs.x.ax);*/
return( regs.x.ax );
}
void SetMode ( mode ) /* set the graphics screen mode */
int mode;
{
union REGS regs;
/*printf("SetMode(mode=%d)\n",mode);*/
/*return;*/
regs.h.ah = 0; /* set graphics mode */
regs.h.al = (char)mode;
int86( 0x10, ®s, ®s );
}